/**
 * Created by Administrator on 2017/2/14.
 */

import React, {Component, PropTypes} from 'react';

export  class Header extends Component {
    componentDidMount() {

        $('.header h1 .back').click(function () {

                window.history.back();
        });


    }

    static propTypes = {
        headerTitle: PropTypes.string,
        headerContent: PropTypes.string,
        className: PropTypes.string
    };

    render(){
        const {className,headerTitle} = this.props;
        let classNames = [''];

        if(className) {
            classNames.push(className);
        }

        return <div className="header">
            <h1>
                <a href="javascript:;"  className={classNames.join(' ')}>
                    <i className="icon icon-return">
                    </i>
                    <span> {headerTitle}</span>
                </a>
                <a  href="#/mall/myOrder" className="myOrderBtn">
                    <span>
                        {this.props.headerContent}
                    </span>
                </a>
            </h1>
        </div>
    }
}

